package net.hn.hnms.biz.safety.monitor.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * 智呈物联 pan'sx
 * 2022/8/30 10:08
 * 1.0 version
 */
@Entity
@Table(name = "dwd_aqjk_now_sensoralarm_count_stat", schema = "aqjk", catalog = "huaneng-safety")
@ApiModel
public class SensorAlarmEntity {
    @Id
    private Long id;
    private String mineCode;
    @ApiModelProperty("传感器编码")
    private String pointCode;
    @ApiModelProperty("传感器类型编码")
    private String sensorType;
    @ApiModelProperty("传感器类型")
    private String sensorTypeName;
    @ApiModelProperty("传感器位置")
    private String pointLocation;
    private String valueUnit;
    @ApiModelProperty("异常类型编码")
    private String outlierType;
    @ApiModelProperty("异常类型")
    private String outlierTypeName;
    @ApiModelProperty("报警开始时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    private Timestamp beginTime;
    private String provinceOrgCode;
    private String supervisorOrgCode;
    @ApiModelProperty("报警结束时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    private Timestamp endTime;
    @ApiModelProperty("最大值")
    private BigDecimal maxValue;
    @ApiModelProperty("最大值时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    private Timestamp maxvalueTime;
    @ApiModelProperty("最小值")
    private BigDecimal minValue;
    @ApiModelProperty("最小值时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    private Timestamp minvalueTime;
    private String analysisOutlierType;
    private String analysisSensorType;
    private String analysisStatisticsType;
    private BigDecimal avgValue;
    @ApiModelProperty("报警原因")
    private String abnormalCause;
    @ApiModelProperty("处置措施")
    private String measure;
    private Timestamp enterTime;
    private String enterUser;
    private Timestamp uploadTime;
    private Timestamp updateTime;
    @ApiModelProperty("最小值时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    private Timestamp dataTime;
    private Timestamp createTime;

    @ApiModelProperty("持续时长")
    @Transient
    private Long duration;

    @Transient
    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    @Basic
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "mine_code")
    public String getMineCode() {
        return mineCode;
    }

    public void setMineCode(String mineCode) {
        this.mineCode = mineCode;
    }

    @Basic
    @Column(name = "point_code")
    public String getPointCode() {
        return pointCode;
    }

    public void setPointCode(String pointCode) {
        this.pointCode = pointCode;
    }

    @Basic
    @Column(name = "sensor_type")
    public String getSensorType() {
        return sensorType;
    }

    public void setSensorType(String sensorType) {
        this.sensorType = sensorType;
    }

    @Basic
    @Column(name = "sensor_type_name")
    public String getSensorTypeName() {
        return sensorTypeName;
    }

    public void setSensorTypeName(String sensorTypeName) {
        this.sensorTypeName = sensorTypeName;
    }

    @Basic
    @Column(name = "point_location")
    public String getPointLocation() {
        return pointLocation;
    }

    public void setPointLocation(String pointLocation) {
        this.pointLocation = pointLocation;
    }

    @Basic
    @Column(name = "value_unit")
    public String getValueUnit() {
        return valueUnit;
    }

    public void setValueUnit(String valueUnit) {
        this.valueUnit = valueUnit;
    }

    @Basic
    @Column(name = "outlier_type")
    public String getOutlierType() {
        return outlierType;
    }

    public void setOutlierType(String outlierType) {
        this.outlierType = outlierType;
    }

    @Basic
    @Column(name = "outlier_type_name")
    public String getOutlierTypeName() {
        return outlierTypeName;
    }

    public void setOutlierTypeName(String outlierTypeName) {
        this.outlierTypeName = outlierTypeName;
    }

    @Basic
    @Column(name = "begin_time")
    public Timestamp getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Timestamp beginTime) {
        this.beginTime = beginTime;
    }

    @Basic
    @Column(name = "province_org_code")
    public String getProvinceOrgCode() {
        return provinceOrgCode;
    }

    public void setProvinceOrgCode(String provinceOrgCode) {
        this.provinceOrgCode = provinceOrgCode;
    }

    @Basic
    @Column(name = "supervisor_org_code")
    public String getSupervisorOrgCode() {
        return supervisorOrgCode;
    }

    public void setSupervisorOrgCode(String supervisorOrgCode) {
        this.supervisorOrgCode = supervisorOrgCode;
    }

    @Basic
    @Column(name = "end_time")
    public Timestamp getEndTime() {
        return endTime;
    }

    public void setEndTime(Timestamp endTime) {
        this.endTime = endTime;
    }

    @Basic
    @Column(name = "max_value")
    public BigDecimal getMaxValue() {
        return maxValue;
    }

    public void setMaxValue(BigDecimal maxValue) {
        this.maxValue = maxValue;
    }

    @Basic
    @Column(name = "maxvalue_time")
    public Timestamp getMaxvalueTime() {
        return maxvalueTime;
    }

    public void setMaxvalueTime(Timestamp maxvalueTime) {
        this.maxvalueTime = maxvalueTime;
    }

    @Basic
    @Column(name = "min_value")
    public BigDecimal getMinValue() {
        return minValue;
    }

    public void setMinValue(BigDecimal minValue) {
        this.minValue = minValue;
    }

    @Basic
    @Column(name = "minvalue_time")
    public Timestamp getMinvalueTime() {
        return minvalueTime;
    }

    public void setMinvalueTime(Timestamp minvalueTime) {
        this.minvalueTime = minvalueTime;
    }

    @Basic
    @Column(name = "analysis_outlier_type")
    public String getAnalysisOutlierType() {
        return analysisOutlierType;
    }

    public void setAnalysisOutlierType(String analysisOutlierType) {
        this.analysisOutlierType = analysisOutlierType;
    }

    @Basic
    @Column(name = "analysis_sensor_type")
    public String getAnalysisSensorType() {
        return analysisSensorType;
    }

    public void setAnalysisSensorType(String analysisSensorType) {
        this.analysisSensorType = analysisSensorType;
    }

    @Basic
    @Column(name = "analysis_statistics_type")
    public String getAnalysisStatisticsType() {
        return analysisStatisticsType;
    }

    public void setAnalysisStatisticsType(String analysisStatisticsType) {
        this.analysisStatisticsType = analysisStatisticsType;
    }

    @Basic
    @Column(name = "avg_value")
    public BigDecimal getAvgValue() {
        return avgValue;
    }

    public void setAvgValue(BigDecimal avgValue) {
        this.avgValue = avgValue;
    }

    @Basic
    @Column(name = "abnormal_cause")
    public String getAbnormalCause() {
        return abnormalCause;
    }

    public void setAbnormalCause(String abnormalCause) {
        this.abnormalCause = abnormalCause;
    }

    @Basic
    @Column(name = "measure")
    public String getMeasure() {
        return measure;
    }

    public void setMeasure(String measure) {
        this.measure = measure;
    }

    @Basic
    @Column(name = "enter_time")
    public Timestamp getEnterTime() {
        return enterTime;
    }

    public void setEnterTime(Timestamp enterTime) {
        this.enterTime = enterTime;
    }

    @Basic
    @Column(name = "enter_user")
    public String getEnterUser() {
        return enterUser;
    }

    public void setEnterUser(String enterUser) {
        this.enterUser = enterUser;
    }

    @Basic
    @Column(name = "upload_time")
    public Timestamp getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(Timestamp uploadTime) {
        this.uploadTime = uploadTime;
    }

    @Basic
    @Column(name = "update_time")
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "data_time")
    public Timestamp getDataTime() {
        return dataTime;
    }

    public void setDataTime(Timestamp dataTime) {
        this.dataTime = dataTime;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SensorAlarmEntity that = (SensorAlarmEntity) o;
        return id == that.id &&
                Objects.equals(mineCode, that.mineCode) &&
                Objects.equals(pointCode, that.pointCode) &&
                Objects.equals(sensorType, that.sensorType) &&
                Objects.equals(sensorTypeName, that.sensorTypeName) &&
                Objects.equals(pointLocation, that.pointLocation) &&
                Objects.equals(valueUnit, that.valueUnit) &&
                Objects.equals(outlierType, that.outlierType) &&
                Objects.equals(beginTime, that.beginTime) &&
                Objects.equals(provinceOrgCode, that.provinceOrgCode) &&
                Objects.equals(supervisorOrgCode, that.supervisorOrgCode) &&
                Objects.equals(endTime, that.endTime) &&
                Objects.equals(maxValue, that.maxValue) &&
                Objects.equals(maxvalueTime, that.maxvalueTime) &&
                Objects.equals(minValue, that.minValue) &&
                Objects.equals(minvalueTime, that.minvalueTime) &&
                Objects.equals(analysisOutlierType, that.analysisOutlierType) &&
                Objects.equals(analysisSensorType, that.analysisSensorType) &&
                Objects.equals(analysisStatisticsType, that.analysisStatisticsType) &&
                Objects.equals(avgValue, that.avgValue) &&
                Objects.equals(abnormalCause, that.abnormalCause) &&
                Objects.equals(measure, that.measure) &&
                Objects.equals(enterTime, that.enterTime) &&
                Objects.equals(enterUser, that.enterUser) &&
                Objects.equals(uploadTime, that.uploadTime) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(dataTime, that.dataTime) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, mineCode, pointCode, sensorType, sensorTypeName, pointLocation, valueUnit, outlierType, beginTime, provinceOrgCode, supervisorOrgCode, endTime, maxValue, maxvalueTime, minValue, minvalueTime, analysisOutlierType, analysisSensorType, analysisStatisticsType, avgValue, abnormalCause, measure, enterTime, enterUser, uploadTime, updateTime, dataTime, createTime);
    }
}
